Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
React's Hooks API but for standard web components and lit-html or hyperHTML.
📚 Read the Docs 📖
<html lang="en">
<my-counter></my-counter>
<script type="module">
import { html } from 'https://unpkg.com/lit?module';
import { component, useState } from 'https://unpkg.com/haunted/haunted.js';
function Counter() {
const [count, setCount] = useState(0);
return html`
<div id="count">${count}</div>
<button type="button" @click=${() => setCount(count + 1)}>
Increment
</button>
`;
}
customElements.define('my-counter', component(Counter));
</script>
</html>
More example integrations can be found in this gist.
Haunted supports the same API as React Hooks. The hope is that by doing so you can reuse hooks available on npm simply by aliasing package names in your bundler's config.
Currently Haunted supports the following hooks:
// Or another renderer, see Guides
type Renderer = (element: Element) => TemplateResult;
interface Options {
baseElement: HTMLElement;
observedAttributes: string[];
useShadowDOM: boolean
}
declare function component(
renderer: Renderer,
options: Options
): Element;
declare function component<BaseElement = HTMLElement>(
renderer: Renderer,
baseElement: BaseElement,
options: Options
): Element
declare function virtual(renderer: Renderer): Directive
BSD-2-Clause
FAQs
Hooks for web components
The npm package haunted receives a total of 0 weekly downloads. As such, haunted popularity was classified as not popular.
We found that haunted demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.